package com.neusoft.exercise;

public class ParentTest {
	int a = 0xa;
	int b = 0xb;
	
	public void myName() {
		System.out.println("I am parent:" + this.toString() + ", a="+a+", b="+b);
	}
	
	public static void main(String argv[]) {
		
		ParentTest p = new ParentTest();
		p.myName();
		
		ChildTest c = new ChildTest();
		ParentTest pc = (ParentTest)c;
		Object o = (Object)c;
		c.myName();
		pc.myName();
		//o.myName();
		
	}
}

class ChildTest extends ParentTest {
	
	ChildTest() {
		a = 1;
		b = 2;
	}
	
	public void myName() {
		System.out.println("I am child:" + this.toString() + ", a="+a+", b="+b);
	}
}
